package com.ssy.lingxi.contract.repository;

import com.ssy.lingxi.contract.entity.ContractInnerRecordDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 合同内部流转记录
 * @author 伍将
 * @date 2021/2/3
 * @version 2.0.0
 */
public interface ContractInnerRecordRepository extends JpaRepository<ContractInnerRecordDO, Long>, JpaSpecificationExecutor<ContractInnerRecordDO> {

    /**
     * 根据合同id、会员id、会员角色id查询内部流转记录，并按操作时间排序
     * @author 伍将
     * @date 2021/2/7
     * @param contractId: 合同id
     * @param memberId: 会员id
     * @param roleId: 会员角色id
     * @return 流转记录列表
     **/
    List<ContractInnerRecordDO> findAllByContractIdAndMemberIdAndRoleIdOrderByOperateTime(Long contractId, Long memberId, Long roleId);
}
